package com.atguigu.inherited;

public class Graphic {//图形
    //定义一个私有的属性：name
    private String name;

    public Graphic() {
        System.out.println("Graphic的无参构造");
    }

    public Graphic(String name) {
        this.name = name;
        System.out.println("Graphic的有参构造");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getInfo(){
        return "图形名称：" + name;
    }
}
